//
//  SalesMoneyCell.m
//  JinChengYun
//
//  Created by 金橙云 on 2017/4/7.
//  Copyright © 2017年 金橙云. All rights reserved.
//
#define H_WIDTH self.frame.size.width
#define HA 15
#define HB (H_WIDTH-HA*5)/4

#import "SalesMoneyCell.h"

@implementation SalesMoneyCell

-(void)layoutSubviews
{
//    //分段控件
//    _segmented = [[UISegmentedControl alloc] initWithItems:@[@"主售房源",@"商业房源",@"配套房源"]];
//    _segmented.selectedSegmentIndex = 0;//设置默认选择项索引
//    _segmented.tintColor = [UIColor orangeColor];
//    [_segmented addTarget:self action:@selector(segmented:) forControlEvents:UIControlEventValueChanged];
//    [self addSubview:_segmented];
//    [_segmented mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.size.mas_equalTo(CGSizeMake(H_WIDTH-8*2, 25));
//        make.left.equalTo(self).offset(8);
//        make.top.equalTo(self.mas_top).offset(2);
//        
//    }];
//    
//    NSArray *arr = @[@"类别",@"今日",@"本月",@"累计"];
//    for (int i= 0; i<4; i++)
//    {
//        UILabel *firstLab = [[UILabel alloc] init];
//        firstLab.frame = CGRectMake(HA+(20+HB)*i, 35,HB, 20);
//        firstLab.textAlignment = NSTextAlignmentCenter;
//        firstLab.font = [UIFont systemFontOfSize:12];
//        firstLab.text = arr[i];
//        [self addSubview:firstLab];
//        
//    }
//    
//    for (int a = 0; a<5; a++)
//    {
//        UILabel *lineLab = [[UILabel alloc] init];
//        lineLab.frame = CGRectMake(0, 30+30*a, H_WIDTH, 0.5f);
//        lineLab.backgroundColor = [UIColor grayColor];
//        [self addSubview:lineLab];
//    }
//    
//    NSArray *arr1 = @[@"实收房款",@"货款到账",@"总计"];
//    for (int b = 0; b<3; b++)
//    {
//        UILabel *shuLab = [[UILabel alloc] init];
//        shuLab.frame = CGRectMake(HA, 65+30*b, HB, 20);
//        shuLab.textAlignment = NSTextAlignmentCenter;
//        shuLab.font = [UIFont systemFontOfSize:12];
//        shuLab.text = arr1[b];
//        [self addSubview:shuLab];
//        
//    }
//    _sDayLab = [[UILabel alloc] init];
//    _sDayLab.text = @"23224u823";
//    _sDayLab.textColor = [UIColor orangeColor];
//    _sDayLab.textAlignment = NSTextAlignmentCenter;
//    _sDayLab.font = [UIFont systemFontOfSize:12];
//    [self addSubview:_sDayLab];
//    [_sDayLab mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.size.mas_equalTo(CGSizeMake(HB, 20));
//        make.left.equalTo(self.mas_left).offset(2*HA+HB);
//        make.top.equalTo(self.mas_top).offset(65);
//    }];
//
    
    
    
    
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self)
    {

        _acceptDic = [NSMutableDictionary dictionary];
        //2 接收通知
        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(acceptHuiMoneyNotific:) name:@"ValueDic" object:nil];
        
    }
    return self;
}

-(void)acceptHuiMoneyNotific:(NSNotification *)noti
{
    _acceptDic = noti.object;
 //   NSLog(@"通知能传过来值吗=======_acceptDic%@",_acceptDic);
    
    
    
    
    
    
}
//具体委托方法
-(void)segmented:(UISegmentedControl *)Seg
{
    
    
    NSInteger Index = Seg.selectedSegmentIndex;
    
    
        if (Index == 0)
        {
            NSLog(@"点击的是第0个");
           // _sDayLab.text = @"点几";
        }
       if (Index == 1)
        {
            NSLog(@"点击的是第1个");
            //_sDayLab.text = @"花花花";
        }
        if (Index == 2)
        {
           NSLog(@"点击的是第2个");
        }
    
//    switch (Index) {
//            
//        case 0:
//            
//            NSLog(@"点击的是第0个");
//            _sDayLab.text = @"点几";
//            
//            
//            break;
//            
//        case 1:
//            
//            NSLog(@"点击的是第一个");
//            _sDayLab.text = @"花花花";
//            break;
//            
//        case 2:
//            
//            NSLog(@"点击的是第二个");
//            
//            break;
//            
//        default:
//            
//            break;
//            
//    }
    
}







- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
